'''
@Descripttion: 只出现一次的数组
@version: v1
@encoding: utf-8
@Author: qiurongcan
Date: 2025-05-15 11:24:34
LastEditTime: 2025-05-15 11:31:04
'''


# 使用异或运算连乘，得到最终结果
class Solution:
    def singleNumber(self, nums:list[int]) -> int:
        res = 0
        for i in nums:
            res ^= i
        
        return res
    

if __name__ == "__main__":

    nums = [2,2,1]
    sol = Solution()
    res = sol.singleNumber(nums)
    print(res)




